package com.zklh.leetcode.top100.problem70;

/**
 * @author Nelson
 * @Description 解法1
 * @create 2023-02-09 11:50
 */
public class Solution1 {

    public int climbStairs(int n) {
        int[] table = new int[n+1];
        table[0] = 1;
        table[1] = 1;

        for (int i = 2; i <= n; i++) {
            table[i] = table[i-1] + table[i-2];
        }
        return table[n];
    }

    public static void main(String[] args) {
        Solution1 solution = new Solution1();
        System.out.println(solution.climbStairs(45));
    }
}
